package 集合.泛型概念;

import java.util.Arrays;
//                                    泛型类！

public class MyArrayList <E>{//后面加个<>,里面随意ETV等等
    Object[] obj=new Object[10];
    int size;
    public boolean add(E e){
        obj[size]=e;
        size++;
        return true;
    }
    public E get(int index){
        return (E)obj[index];

    }



    @Override
    public String toString() {
        return "MyArrayList{" +
                "obj=" + Arrays.toString(obj) +
                ", size=" + size +
                '}';
    }
}
